import { requestApi } from "@/utils/request"
import type { UserConcernResponse } from "@/types/concern"

// 获取用户关注的作者以及作者的游记
export const getConcernAPI = (page: number) => {
    return requestApi<UserConcernResponse>({
        url: '/user-following-author',
        method: 'GET',
        data: {
            page
        }
    })
}

// 取消点赞
export const cancelConcernAPI = (article_id: string) => {
    return requestApi({
        url: '/cancel-like',
        method: 'GET',
        data: {
            article_id
        }
    })
}

// 用户给游记点赞
export const giveAlikeAPI = (article_id: string) => {
    return requestApi({
        url: '/user-like',
        method: 'GET',
        data: {
            article_id
        }
    })
}

// 用户取消收藏
export const cancelCollectionAPI = (article_id: string) => {
    return requestApi({
        url: '/cancel-collection',
        method: 'GET',
        data: {
            article_id
        }
    })
}

// /用户收藏游记
export const collectTravelAPI = (article_id: string) => {
    return requestApi({
        url: '/collect-travel',
        method: 'GET',
        data: {
            article_id
        }
    })
}